package com.itheima.service;

import com.itheima.domain.Book;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author jay
 */
@Transactional
public interface BookService {
    /**
     * 增加
     * @param book
     * @return
     */
    boolean save(Book book);

    /**
     * 修改
     * @param book
     * @return
     */
    boolean update(Book book);

    /**
     * 按id删除
     * @param id
     * @return
     */
    boolean delete(Integer id);

    /**
     * 按id查找
     * @param id
     * @return
     */
    Book selectById(Integer id);

    /**
     * 查询所有
     * @return
     */
    List<Book> selectAll();
}
